package com.zcl.controller;

import com.zcl.pojo.R;
import com.zcl.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/student")
@RestController
public class StudentController {
//    自动注入studentservice
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    public R findAll(){
        return R.ok().put("students",studentService.findAll());
    }
}
